package com.yhm.net.BIO服务端对客户端连接交由单独的线程处理;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class BIOClient {
  public static void main(String[] args) {
    try {
      Socket socket = new Socket("127.0.0.1", 8080);

      OutputStream outputStream = socket.getOutputStream();
      Scanner scanner = new Scanner(System.in);
      String str = scanner.nextLine();
      outputStream.write(str.getBytes());

      outputStream.close();
      socket.close();
      scanner.close();

    } catch (IOException e) {
      e.printStackTrace();
    }


  }

  }
